﻿@model CarparkBusiness.ParkingSetting
@{
    ViewBag.Title = "Backend Computing Setting";
}
<div class="container">
    <div class="row">
        <div class="col-12 pl-5"> 
            <form  asp-action="GetParkingSetting" data-ajax-success="retParkingSetting"
                  asp-ajax-onFailure="errParkingSetting" data-ajax="true" data-ajax-method="post" class="form-horizontal" id="formGetParkingSetting" name="formGetParkingSetting">

                <input id="MaxIntervalTimes" name="MaxIntervalTimes" value="@Model.MaxIntervalTimes" type="hidden" />
                <input id="IntervalTimes" name="IntervalTimes" value="@Model.IntervalTimes" type="hidden" />
                <input id="OnlyRegistered" name="OnlyRegistered" value="@Model.OnlyRegistered" type="hidden" />
                 
                <div class="form-group  mb-2">
                    <label class="control-label col-12 h3 text-primary">Setting</label>
                </div>

                <div class="form-group  mb-2">
                    <label class="control-label col-12" for="HistDateBegin">
                        <i class="fas fa-clock" style="color:forestgreen;padding-right:5px;"></i>History Date Begin (minutes)
                    </label>

                    <div class="input-group">
                        <input id="HistDateBegin" type="number" value="@Model.HistDateBegin" class="text-dark form-control  col-md-3" />
                        <div class="input-group-append input-group-sm">
                            <span class="input-group-text border-left-0" style="background-color:#faf9eb">
                                <i class="fas fa-angle-double-right" style="color:forestgreen;font-size:11px"></i>
                            </span>
                        </div>
                    </div>
                </div>

                <div class="form-group  mb-2">
                    <label class="control-label col-12" for="IntervalSeconds">
                        <i class="fas fa-satellite-dish" style="color:forestgreen;padding-right:5px;"></i>Capture Interval Seconds (From Camera)
                    </label>

                    <div class="input-group">
                        <input id="IntervalSeconds" type="number" value="@Model.IntervalSeconds" class="text-dark form-control  col-md-3" />
                        <div class="input-group-append input-group-sm">
                            <span class="input-group-text border-left-0" style="background-color:#faf9eb">
                                <i class="fas fa-angle-double-right" style="color:forestgreen;font-size:11px"></i>
                            </span>
                        </div>
                    </div>
                </div>

                <div class="form-group  mb-2">
                    <label class="control-label col-12" for="AllowanceSeconds">
                        <i class="fas fa-stopwatch" style="color:forestgreen;padding-right:5px;"></i>Allowance Seconds (seconds)
                    </label>

                    <div class="input-group">
                        <input id="AllowanceSeconds" name="AllowanceSeconds" type="number" value="@Model.AllowanceSeconds" class="text-dark form-control  col-md-3" />
                        <div class="input-group-append input-group-sm">
                            <span class="input-group-text border-left-0" style="background-color:#faf9eb">
                                <i class="fas fa-angle-double-right" style="color:forestgreen;font-size:11px"></i>
                            </span>
                        </div>
                    </div>
                </div>

                <div class="form-group  mb-2">
                    <label class="control-label col-12" for="AllowanceSeconds">
                        <i class="fas fa-business-time" style="color:forestgreen;padding-right:5px;"></i>Minimum Valid Times 
                    </label>

                    <div class="input-group">
                        <input id="MinTimesValid" name="MinTimesValid" type="number" value="@Model.MinTimesValid" class="text-dark form-control col-md-3" />
                        <div class="input-group-append input-group-sm">
                            <span class="input-group-text border-left-0" style="background-color:#faf9eb">
                                <i class="fas fa-angle-double-right" style="color:forestgreen;font-size:11px"></i>
                            </span>
                        </div>
                    </div>
                </div>

                <div class="form-group  mb-2">
                    <label class="control-label col-12" for="HistoryRecordRemain">
                        <i class="fas fa-business-time" style="color:forestgreen;padding-right:5px;"></i>History Record Remain (Days)
                    </label>

                    <div class="input-group">
                        <input id="HistoryRecordRemain" name="HistoryRecordRemain" type="number" value="@Model.HistoryRecordRemain" class="text-dark form-control col-md-3" />
                        <div class="input-group-append input-group-sm">
                            <span class="input-group-text border-left-0" style="background-color:#faf9eb">
                                <i class="fas fa-angle-double-right" style="color:forestgreen;font-size:11px"></i>
                            </span>
                        </div>
                    </div>
                </div>
                <!--IntervalMinutes-->
                <div class="form-group  mb-2">
                    <label class="control-label col-12" for="IntervalMinutes">
                            <i class="fas fa-business-time" style="color:forestgreen;padding-right:5px;"></i> Job Task Running Intervals (mins)
                    </label> 
                    <div class="input-group">
                        <input id="IntervalMinutes" name="IntervalMinutes" type="number" value="@Model.IntervalMinutes" class="text-dark form-control col-md-3" />
                        <div class="input-group-append input-group-sm">
                            <span class="input-group-text border-left-0" style="background-color:#faf9eb">
                                <i class="fas fa-angle-double-right" style="color:forestgreen;font-size:11px"></i>
                            </span>
                        </div>
                    </div>
                </div>

                <div class="form-group  pt-3 pb-1">
                    <div class="d-flex flex-row">
                        <div class="bd-highlight pr-2">
                            <button type="submit" class="btn btn-primary flat AntiSubmit mr-4">
                                Submit
                            </button>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
<script> 
    function retParkingSetting(res) {

        console.log(res);

        layer.open({
            title: 'Settings Return Info'
            , content: res.meta.message
            , btn: 'OK'
        });
    }

    function errParkingSetting(data) {
        console.log({ "data": data });
        alert("FUNC::ParkingSetting:ERROR");
    }
</script>

